<!DOCTYPE html>
<!--[if lt IE 7 ]><html dir="ltr" lang="zh-CN" class="no-js ie ie6 lte7 lte8 lte9"><![endif]-->
<!--[if IE 7 ]><html dir="ltr" lang="zh-CN" class="no-js ie ie7 lte7 lte8 lte9"><![endif]-->
<!--[if IE 8 ]><html dir="ltr" lang="zh-CN" class="no-js ie ie8 lte8 lte9"><![endif]-->
<!--[if IE 9 ]><html dir="ltr" lang="zh-CN" class="no-js ie ie9 lte9"><![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--><html dir="ltr" lang="zh-CN"><!--<![endif]-->
<head>

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <meta name="renderer" content="webkit|ie-stand">  <title>2017成都国际马拉松赛</title>
    
    

    <link href="<?php echo STATICSPATH;?>css/bootstrap.css" rel="stylesheet" type="text/css">
    <link href="<?php echo STATICSPATH;?>css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <link href="<?php echo STATICSPATH;?>css/iconfont.css" rel="stylesheet" type="text/css">
    <link href="<?php echo STATICSPATH;?>css/icheck/yellow.css" rel="stylesheet" type="text/css">
    <link href="<?php echo STATICSPATH;?>css/swiper.min.css" rel="stylesheet" type="text/css">
    <link href="<?php echo STATICSPATH;?>css/style.css" rel="stylesheet" type="text/css">

    <!--[if lte IE 9 ]>
    <link href="<?php echo STATICSPATH;?>css/ie.css" rel="stylesheet" type="text/css"/>
    <![endif]-->

    <!--[if lt IE 9]>
    <script src="<?php echo STATICSPATH;?>scripts/lib/html5shiv.min.js"></script>
    <script src="<?php echo STATICSPATH;?>scripts/lib/respond.min.js"></script>
    <![endif]-->



<script src="<?php echo STATICSPATH;?>scripts/lib/jquery-1.12.4.min.js" type="text/javascript"></script>

<link href="<?php echo STATICSPATH;?>css/mui.min.css" rel="stylesheet" />
<script src="<?php echo STATICSPATH;?>js/mui.min.js"></script>
<script type="text/javascript" src="<?php echo STATICSPATH;?>js/jSignature.min.js"></script>


</head>

<body>

<form id="signform">
<div align="center" class="quernhan" ><img src="<?php echo STATICSPATH;?>images/quren.png" alt=""/>
	<p class="haoma"><?php if(!empty($order_info['match_code']) && date('YmdHis')>'20170908100000'){ echo $order_info['match_code'];}else{echo '待分配';}?></p>
	<p class="name"><?php echo $order_info['realname'];?></p>
	<p class="zhangjian"><?php echo $order_info['id_number'];?></p>
	<p class="yifu"><?php echo $order_info['cloth_size'];?></p>
	<p class="qianming"></p>



	<!--签div名区域div from taishan  位置css调整-->
	<div class="nc-reg">
		<div id="signature" style="height: 100%;border:1px dashed #000;" ></div>
	    <div class="tishi">请签名确认</div>
		<div id="pic" />
			<p id="base" style="width:100%;height: 100%;"></p>
		</div>
	</div>
	<!--签名div区域 from taishan  位置css调整-->




</div>



<!--需要有一个提交按钮  位置css调整-->
<div class="form-group lingwu">
    <div class="btn-mc-center ">
    	<a href="javascript:void(0);" id="btn-red" class="btn btn-default">提交</a>
        	<input id="clear" type="button" value="重签"  class="chongqian"  style="color:#fff;">
    </div>
</div>
<!--需要有一个提交按钮  位置css调整-->




<input type="hidden" name="order_id" id="order_id" value="<?php echo $order_id;?>">
<input type="hidden" name="identity" id="identity" value="<?php echo $order_info['id_number'];?>">


<script type="text/javascript" charset="utf-8">
	mui.plusReady(function() {
		plus.screen.lockOrientation('landscape-secondary');
	});
	$(document).ready(function() {
		$("#signature").jSignature({color:"#000",lineWidth:2,height:'100%',width:'100%'});  //设置签名区宽高，也是最终生成图片的宽高。可以写百分数，也可以写整数。经试验，写整数有时对鼠标不敏感。from taishan
	});
	document.getElementById("clear").addEventListener('tap', function() {
		$("#signature").jSignature("reset");
		$("#pic")[0].innerHTML = '';
	});
</script>

<script>
 	document.getElementById("btn-red").addEventListener('tap', function() {
		var datapair = $("#signature").jSignature("getData", "image");
		var identity = $("#identity").val();
		var order_id = $("#order_id").val();
		//alert(identity);return;
		//console.log(datapair);return;
		//var i = new Image();
		//i.src = "data:" + datapair[0] + "," + datapair[1];
		//$(i).appendTo($("#pic"));
		var sign_pic="data:" + datapair[0] + "," + datapair[1];
		//alert(datapair[0]);return;
		$.post("/service/savesign",$("#signform").serialize()+'&sign_pic='+encodeURIComponent(sign_pic)+'&identity='+encodeURIComponent(identity) , function(result){
			var ret = $.parseJSON(result); 
			if(ret.success=='success'){
            	 location.href="/baoming/ling_wu_showsign/identity/"+identity+"/order_id/"+order_id;
            }
            else{
            	alert(ret.success);
            	//alert(ret.errorMessage);
            }
			
			//window.history.go(-1);
		});
	});
</script>




</form>
</body>
</html>
